1. Field of the Invention
The present invention relates to an image data encoding and decoding technique.
2. Description of the Related Art
Conventionally, a technique of dividing an input image into predetermined sized blocks and encoding the divided image blocks using an orthogonal transformation is known. The encoding using orthogonal transformation is effective compression for natural images (continuous tone image). On the other hand, for images including a character or line-art image and the like (hereinbelow, text image), “mosquito noise” and block distortion occur due to loss of image high frequency components, and excellent results cannot be obtained.
To solve this problem, intra-block 2-color processing is proposed. In this processing, in an image where resolution is more important than tonality such as an image including a character/line-art portion, the resolution is maintained by approximation of pixels in image blocks to 2 colors. Japanese Patent Application Laid-Open No. Hei 05-056282 disclosing execution of the 2 color processing is known. In the 2 gray-level block approximation encoding disclosed in the document, the pixels in a block image are regarded as a 2-color image, and identification information is generated to identify each pixel as one of these 2 colors. Then, the identification information and 2 color pixel values are packed, thereby encoding processing is performed. For example, when image data of 8×8 pixel-sized block is 2-color processed and encoded, all the 64 bit data are stored as identification information, then as color data, 8 bit data is stored for 2 colors, and total 80-bit fixed-length encoded data is outputted. Similarly, when 16×16 pixel-sized block image data is encoded, the identification information is 256 bits, and the color data is 8 bits×2=16 bits. In this case, total 272 bit fixed-length encoded data is outputted.
Generally, compressed data is stored in an external memory or the like, however, access to the external memory is often made with 4 bytes×N (where N is a power of 2). In the above related art, access efficiency is low. For example, regarding the above-described 8×8 block size, 64 bits is desirable. Further, regarding the above-described 16×16 block size, 256-bit fixed-length encoding is desirable.